<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input {
            color: #999;
            outline-color: pink;
            /* outline: none; */
        }
    </style>
</head>

<body>
    <div class="box">
        <input type="text" value="邮箱/ID/手机号">
        <input type="text" value="密码">

    </div>
    <script>
        var inp = document.querySelector('input')

        inp.onfocus = function () {
            if (this.value == '邮箱/ID/手机号') {
                this.value = '';
            }
            this.style.color = '#333';
        }
        inp.onblur = function () {
            if (this.value == '') {
                this.value = '邮箱/ID/手机号';
            }
            this.style.color = '#999';
        }


    </script>
</body>

</html>